package com.start.handler;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;

public class MyExceptionControllerResolver implements HandlerExceptionResolver {
	/**
	 * Exception: 接送被抛出 的异常
	 */
	@Override
	public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, Object handler,
			Exception ex) {
		System.out.println("------------->>>>---------------");
		System.out.println(ex.getMessage());

		ModelAndView andView = new ModelAndView();
		andView.addObject("abc", "123456789");
		andView.setViewName("successException");

		return andView;
	}
}
